﻿using ApiService.EF;
using ApiService.EF.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ApiService.Service
{
    public class UserService : IUserService
    {
        public UserService(ApplicationDbContext dbContext)
        {
            dbcontext = dbContext;
        }

        public ApplicationDbContext dbcontext { get; }

        public string Add()
        {
            dbcontext.Users.Add(new UserEntity
            {
                UserName = "zhangsan",
                RealName = "张三",
                Password = "123456"
            });
            dbcontext.Users.Add(new UserEntity
            {
                UserName = "lisi",
                RealName = "李四",
                Password = "123456"
            });
            int result = dbcontext.SaveChanges();
            return result.ToString();
        }
    }
}
